﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CardInChina.Bussiness.Frontend.Models;
using System.Diagnostics;

namespace CardInChina.Test
{
    [TestClass]
    public class PayInterfaceModel_Test
    {
        [TestMethod]
        public void TestMethod1()
        {
            TencentCFT cft = new TencentCFT();
            Debug.WriteLine(cft.Render());
        }
    }

    public class TencentCFT : PayInterfaceModel
    {
        [Field("cmdno")]
        public string CMDNo { get; set; }

        [Field("date")]
        public string Date { get; set; }

        [Field("bank_type")]
        public string BankType { get; set; }

        [Field("desc")]
        public string Description { get; set; }

        [Field("purchaser_id")]
        public string PurchaserId { get; set; }

        [Field("bargainor_id")]
        public string BargainorId { get; set; }

        [Field("transaction_id")]
        public string TransactionId { get; set; }

        [Field("sp_billno")]
        public string SPBillNo { get; set; }

        [Field("total_fee")]
        public string TotalFee { get; set; }

        [Field("fee_type")]
        public string FeeType { get; set; }

        [Field("return_url")]
        public string ReturnUrl { get; set; }

        [Field("attach")]
        public string Attach { get; set; }

        [Field("sign")]
        public string Sign { get; set; }

        public TencentCFT() : base("https://www.tenpay.com/cgi-bin/v1.0/pay_gate.cgi","post")
        {
        }


        protected override void RenderSubmit(StringBuilder sb)
        {
            sb.Append("<input name=\"Submit\" type=\"submit\" value=\"财付通\"/>");
        }
    }
}
